package mercurius.fitness.client.rb.exercise.forms;

import com.google.gwt.user.client.rpc.AsyncCallback;

import mercurius.fitness.client.locale.Locale;
import mercurius.fitness.client.rb.exercise.Exercise;
import mercurius.fitness.client.rb.exercise.ExerciseRB;
import net.pleso.framework.client.bl.forms.IEditForm;
import net.pleso.framework.client.bl.forms.items.IFormItemsGroup;
import net.pleso.framework.client.dal.IDataRow;

public class EditExerciseForm extends ExerciseForm implements IEditForm {

	private Integer id = null;
	
	public EditExerciseForm(Integer id) {
			this.id = id;
	}
	
	public void updateRow(IDataRow row, AsyncCallback callback) {
		ExerciseRB.getDataSet().update((Exercise) row, callback); 
	}

	public void GetData(AsyncCallback callback) {
		ExerciseRB.getDataSet().get(this.id, callback);
	}

	public String getCaption() {
		return Locale.constants().edit_exercise_caption();
	}

	public IFormItemsGroup[] getGroups() {
		return groups;
	}
}
